<template>
  <div class="leaderboard">
    <el-table
      :data="leaderboardData"
      style="width: 100%;"
      border
    >
      <el-table-column label="序号" width="60" align="center">
        <template slot-scope="{ row, $index }">
          <span>{{ $index + 1 }}</span>
        </template>
      </el-table-column>
      <el-table-column label="学员姓名" prop="userName" align="center"/>
      <el-table-column label="任务名称" prop="proposeName" align="center"/>
      <el-table-column label="完成时间" prop="completeTime" align="center"/>

    </el-table>
  </div>
</template>

<script>
import {listByCreateTIme} from "../../api/home";

export default {
  data() {
    return {
      leaderboardData: [],
    };
  },
  created() {
    this.initData()
  },
  methods:{
    initData(){
      listByCreateTIme().then(res=>{
        this.leaderboardData = res.rows
      })
    }
  }
};
</script>

<style lang="scss" scoped>
.leaderboard{
  padding: 10px 0;
}
</style>
